<template>
  <free-app bgType="image" :showNavbar="false">
    <wd-navbar
      safeAreaInsetTop
      :bordered="false"
      custom-style="background-color: transparent !important;"
    >
      <template #left>
        <view
          class="color-text-1 text-[34rpx] flex items-center font-bold"
          @click="jumpTochoose"
        >
          <view class="flex items-center"> 永丰手机维修（芦墟镇） </view>
          <image
            class="w-[18rpx] h-[12rpx] ml-[6rpx]"
            src="/static/images/icon/arrow.png"
          ></image>
        </view>
      </template>
    </wd-navbar>
    <view class="p-3 flex flex-col gap-[40rpx]">
      <view class="flex justify-between items-center gap-2">
        <view class="flex items-center gap-[16rpx]">
          <image
            :src="userInfo.imgUrl"
            class="size-[108rpx] rounded-full"
            mode="scaleToFill"
          />
          <view class="">
            <view class="mb-[6rpx] font-500 text-color-1 text-size-5">
              {{ userInfo.name }}
            </view>
            <view class="color-text-2 text-size-1"> so </view>
          </view>
        </view>
        <image
          @click="jumpToCode"
          src="/static/images/icon/qrCode.png"
          class="size-[56rpx]"
          mode="scaleToFill"
        />
      </view>
      <view class="grid grid-cols-3 gap-[24rpx]">
        <view class="flex flex-col gap-[12rpx] justify-center items-center">
          <GsMoney
            :money="userInfo.price"
            :showUnitIcon="true"
            :moneySize="`40rpx`"
            moneyUnitSize="28rpx"
            color="#000"
          ></GsMoney>
          <view class="color-[#5B5B5B]"> 库存 </view>
        </view>
        <view class="flex flex-col gap-[12rpx] justify-center items-center">
          <GsMoney
            :money="userInfo.price1"
            :showUnitIcon="true"
            :moneySize="`40rpx`"
            moneyUnitSize="28rpx"
            color="#000"
          ></GsMoney>
          <view class="color-[#5B5B5B]"> 佣金 </view>
        </view>
        <view class="flex flex-col gap-[12rpx] justify-center items-center">
          <GsMoney
            :money="userInfo.price2"
            :showUnitIcon="true"
            :moneySize="`40rpx`"
            moneyUnitSize="28rpx"
            color="#000"
          ></GsMoney>
          <view class="color-[#5B5B5B]"> 优惠券 </view>
        </view>
      </view>
    </view>
    <view class="bg-white rounded-t-[48rpx] px-3 pt-[40rpx] h-[100vh]">
      <view class="grid grid-cols-4 gap-x-3 gap-y-[40rpx]">
        <view
          class="flex flex-col gap-1 items-center justify-center"
          v-for="(item, index) in shopData"
          :key="index"
          @click="item.cb"
        >
          <image :src="item.icon" class="size-[88rpx]" />
          <view> {{ item.name }} </view>
        </view>
      </view>
    </view>
  </free-app>
</template>

<script setup>
import { ref } from "vue";
import SearchBox from "@/components/search-box/index.vue";
import GsMoney from "@/components/GsMoney/index.vue";
import { onLoad } from "@dcloudio/uni-app";
import { onShow } from "@dcloudio/uni-app";
const navbarOptions = {
  title: "地址管理",
  placeholder: true,
  remark: "",
};
const userInfo = ref({
  imgUrl: "/static/images/temp/logo.png",
  name: "华强北一层a01店",
  description: "适配型号苹果12/苹果12Pro",
  price: "129.9",
  price2: "129.9",
  price3: "129.9",
});

const shopData = ref([
  {
    name: "顾客订单",
    icon: "/static/images/shop/order.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "售后管理",
    icon: "/static/images/shop/after.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "库存管理",
    icon: "/static/images/shop/management.png",
    cb: () => {
    //   uni.showToast({
    //     title: "暂未开放",
    //     icon: "none",
    //   });
      uni.navigateTo({
      url:'/pagesShop/inventoryList'
      })
    },
  },
  {
    name: "库存配送",
    icon: "/static/images/shop/express.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "账户明细",
    icon: "/static/images/shop/wallet.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "小店销售",
    icon: "/static/images/shop/saleTotal.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "滞销商品",
    icon: "/static/images/shop/noSale.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "供应商售后",
    icon: "/static/images/shop/suppliers.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "库存盘点",
    icon: "/static/images/shop/pandian.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "消息通知",
    icon: "/static/images/shop/notice.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "我的群组",
    icon: "/static/images/shop/group.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
  {
    name: "销售设置",
    icon: "/static/images/shop/sale.png",
    cb: () => {
      uni.showToast({
        title: "暂未开放",
        icon: "none",
      });
      // uni.navigetTo({
      // url:'/pages/order/index'
      // })
    },
  },
]);
const jumpToCode = () => {
  uni.navigateTo({
    url: "/pagesShop/code",
  });
};
</script>

<style lang="scss" scoped></style>
